home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8629 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: ch-as27.peinet.pe.ca!wbmcmast
  2. From: wbmcmast@bud.peinet.pe.ca
  3. Newsgroups: comp.lang.c++
  4. Subject: Trouble writing windows DLL in Borland C++ 4.5
  5. Date: Thu, 15 Feb 1996 10:14:38 LOCAL
  6. Organization: PEINet
  7. Message-ID: <wbmcmast.2.00659551@bud.peinet.pe.ca>
  8. NNTP-Posting-Host: ch-as27.peinet.pe.ca
  9. X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4]
  10.  
  11. I am writing my first DLL in BC++ 4.5 and am having some problems.  I have 
  12. written other DLL's in BC++ 2.0 and didn't have too much problem, although the 
  13. code in the DLL did not have any Windows related stuff in it.  
  14.  
  15. The ultimate goal is to add some functionality to WordPerfect 5.2.  This the
  16. same thing that I did with the last one I wrote.   
  17.  
  18. I am starting up the learning curve by using the dlldemo project that comes 
  19. with BC++ 4.5.  I have the DLLSHELL.CPP in front of me and see the LibMain() 
  20. and the WEP() functions.  When I wrote the one in 2.0 I just included the 
  21. LibMain() and WEP() functions and then several _export functions and compiled 
  22. and linked it as a DLL file.
  23.  
  24. When I tried this in BC++ 4.5, I can't even get it linked.  The linker seems 
  25. to be looking for a definition for OwlMain(-----).  The only way I can get it 
  26. to link is to define a WinMain() function.  When I do this however, then 
  27. WordPerfect seems to complain that the resulting .exe is not a dll.  I have
  28. the 16 bit Compiler Entry/Exit Code set to Windows DLL all functions exportable
  29.  
  30.  
  31. What am I doing wrong here?  How can I get BC++4.5 to generate a .dll file?
  32. Do I need WinMain() and LibMain()?  Why do I get the linker error when I
  33. try to link without the WinMain()?
  34.  
  35. W.B.McMaster
  36. Veterans Affairs Canada
  37. mcmaster@cycor.ca
  38.